from kafka import KafkaConsumer

consumer = KafkaConsumer('multirecord',
                             auto_offset_reset='earliest',
                             enable_auto_commit=False,
                             bootstrap_servers=['10.36.8.128:9092'],
                             fetch_max_bytes=1048576000
                             )
count = 0

for message in consumer:
    # message value and key are raw bytes -- decode if necessary!
    # e.g., for unicode: `message.value.decode('utf-8')`
    # count+=1
    # print len(message.value)
    print message.value
    # print ("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition,
    #                                       message.offset, message.key,
    #                                       message.value))

# print count                                    00000000